// app.js
const express = require('express');
const app = express();


const userRoutes = require('./routers/users');
const roleRoutes = require('./routers/roles');
const permissionRoutes = require('./routers/Permission');
// 必须添加以下中间件！
app.use(express.json()); // 解析 JSON 格式的请求体
app.use(express.urlencoded({ extended: true })); // 解析表单格式的请求体

app.use('/users', userRoutes);
app.use('/roles', roleRoutes);
app.use('/Permissions', permissionRoutes);

app.listen(3000, () => {
  console.log('Server is running on port 3000');
  console.log("服务器监听的地址是:http:127.0.0.1:3000")
});